
// preload.js
const { contextBridge, ipcRenderer } = require('electron');

contextBridge.exposeInMainWorld('electronAPI', {
    sendLog: (message) => ipcRenderer.send('log-message', message),
    openSettingsWindow: () => ipcRenderer.invoke('open-settings-window'),
    userLogin:( username, password) => ipcRenderer.invoke('user-login', username, password),
    getServerAddress: () => ipcRenderer.invoke('get-server-address'), // 获取服务器地址
    saveServerAddress: (address) => ipcRenderer.invoke('save-server-address', address), // 保存服务器地址
});

